from fdfs_client.client import Fdfs_client
from rest_framework import serializers
from rest_framework.response import Response

from apps.goods.models import SKUImage, SKU


class SKU_Image_Serializer(serializers.ModelSerializer):
    #外键要写外面
    # 因为sku_id是外键 所以要外键变主键显示
    sku = serializers.PrimaryKeyRelatedField(read_only=True)
    class Meta:
        model = SKUImage
        fields = ['sku','image','id']
class Add_all_skuSerializer(serializers.ModelSerializer):
    class Meta:
        model = SKU
        fields = ['id','name']

